"<html>\r\n"
"<!--\r\n"
"Admin.html\r\n"
"\r\n"
"SRV Administration Page\r\n"
"\r\n"
"This code is embedded in the SRV system, not uploaded to separate flash sectors\r\n"
"-->\r\n"
"\r\n"
"<head>\r\n"
"<meta name=\"viewport\" content=\"width=device-width; initial-scale=1.0; maximum-scale=1.0;\">\r\n"
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\r\n"
"<title>SRV Admin</title>\r\n"
"\r\n"
"\r\n"
"<style type=\"text/css\">\r\n"
"\r\n"
"body\r\n"
"{\r\n"
"    font-family: Arial;\r\n"
"    font-size: 10pt;\r\n"
"}\r\n"
"\r\n"
"</style>\r\n"
"\r\n"
"\r\n"
"</head>\r\n"
"\r\n"
"\r\n"
"<body>\r\n"
"\r\n"
"<script>\r\n"
"\r\n"
"var flashSectorsFirst = 4,\r\n"
"    flashSectorsLast = 62,\r\n"
"    flashSectorsUnit = 2;\r\n"
"\r\n"
"var btnXhr;\r\n"
"var btnReqTimerId;\r\n"
"var btnAborted;\r\n"
"\r\n"
"\r\n"
"function onUploadSubmit (evt)\r\n"
"{\r\n"
"    //\r\n"
"    // Validate fields\r\n"
"    //\r\n"
"    var file = document.getElementById (\"fileItem1\").value;\r\n"
"    if (file == null  ||  file == \"\")\r\n"
"    {\r\n"
"        alert (\"Please select a file to upload.\");\r\n"
"        evt.cancelBubble = true;\r\n"
"        evt.returnValue = false;\r\n"
"        return;\r\n"
"    }\r\n"
"\r\n"
"    if (document.getElementById (\"toSectors\").checked)\r\n"
"    {\r\n"
"        var start = document.getElementById (\"sectorStart\").value;\r\n"
"        if (start < flashSectorsFirst  ||  start > flashSectorsLast)\r\n"
"        {\r\n"
"            alert (\"Starting sector must be between \" + flashSectorsFirst + \" and \" + flashSectorsLast + \".\");\r\n"
"            evt.cancelBubble = true;\r\n"
"            evt.returnValue = false;\r\n"
"            return;\r\n"
"        }\r\n"
"\r\n"
"    }\r\n"
"\r\n"
"    if (document.getElementById (\"toBootLoader\").checked)\r\n"
"    {\r\n"
"        if (!document.getElementById (\"confirmBootLoader\").checked)\r\n"
"        {\r\n"
"            alert (\"Please check 'Check to confirm' to confirm boot loader flash.\")\r\n"
"            evt.cancelBubble = true;\r\n"
"            evt.returnValue = false;\r\n"
"            return;\r\n"
"        }\r\n"
"    }\r\n"
"}\r\n"
"\r\n"
"\r\n"
"function onResetBtn ()\r\n"
"{\r\n"
"    if (confirm (\"DANGER!\\nTo confirm SRV reset, click OK\"))\r\n"
"    {\r\n"
"        btnXhr = new XMLHttpRequest();\r\n"
"        btnXhr.open (\"GET\", \"robot.cgi?$!&b=\" + new Date().getTime(), true);\r\n"
"        btnXhr.setRequestHeader (\"Cache-Control\", \"no-cache\");\r\n"
"        btnXhr.setRequestHeader (\"Pragma\", \"no-cache\");\r\n"
"        btnXhr.onreadystatechange = resetBtnComplete;\r\n"
"        btnReqTimerId = setTimeout (resetBtnTimeout, 5000);\r\n"
"        btnAborted = false;\r\n"
"        btnXhr.send (null);\r\n"
"    }\r\n"
"}\r\n"
"\r\n"
"\r\n"
"function resetBtnComplete ()\r\n"
"{\r\n"
"    if (!btnAborted  &&  btnXhr.readyState == 4)\r\n"
"    {\r\n"
"        clearTimeout (btnReqTimerId);\r\n"
"        document.body.innerHTML = \"SRV reset initiated...\";\r\n"
"    }\r\n"
"}\r\n"
"\r\n"
"\r\n"
"function resetBtnTimeout ()\r\n"
"{\r\n"
"    btnAborted = true;\r\n"
"    btnXhr.abort();\r\n"
"    alert (\"SRV Reset timed out. No reset initiated.\");\r\n"
"}\r\n"
"\r\n"
"\r\n"
"\r\n"
"</script>\r\n"
"\r\n"
"<p style=\"font-variant: small-caps\"><big><big>SRV Admin</big></big></p>\r\n"
"\r\n"
"<p style=\"background-color: $$statusColor$$; padding-top: 4px; padding-bottom: 4px;\">$$statusMsg$$</p>\r\n"
"\r\n"
"<div style=\"font-size: 10pt\">\r\n"
"    <form encType=\"multipart/form-data\" method=\"post\" action=\"admin\" onsubmit=\"onUploadSubmit(event)\">\r\n"
"        <p><big><b>Upload and Flash File</b></big><p>\r\n"
"        <p>File to flash:<br>\r\n"
"        <input id=\"fileItem1\" type=\"file\" name=\"fileItem1\" size=\"100%\" style=\"width: 100%\" accept=\"*\"></p>\r\n"
"\r\n"
"        <p><input id=\"toSectors\" type=\"radio\" name=\"uploadRadios\" value=\"toSectors\" checked>To sectors starting at:<br>\r\n"
"        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input id=\"sectorStart\" name=\"sectorStart\" style=\"width: 4em\" value=\"\"></p>\r\n"
"\r\n"
"        <p><input id=\"toBootLoader\" type=\"radio\" name=\"uploadRadios\" value=\"toBootLoader\">To boot loader:<br>\r\n"
"        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input id=\"confirmBootLoader\" name=\"confirmBootLoader\" type=\"checkbox\">Check to confirm</p>\r\n"
"    \r\n"
"        <p><input type=\"submit\" style=\"width: 10em\" value=\"Flash\"></p>\r\n"
"    </form>\r\n"
"</div>\r\n"
"\r\n"
"<hr>\r\n"
"\r\n"
"\r\n"
"<div>\r\n"
"\r\n"
"    <p align=\"left\"><input id=\"resetBtn\" type=\"button\" value=\"Reset SRV\" onclick=\"onResetBtn()\"\r\n"
"    style=\"width: 7em; font-size: 8pt; color: #000000; background-color: #ff6060\"></p>\r\n"
"\r\n"
"    <p style=\"font-size: 8pt\">$$version$$</p>\r\n"
"\r\n"
"</div>\r\n"
"\r\n"
"</body>\r\n"
"</html>\r\n"
